﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CustomControllerFactory.Controllers
{
    public class HomeController : Controller
    {
        private ILoggerService _loggerService;
        private IAddService _addService;
        public HomeController(ILoggerService loggerService, IAddService addService)
        {
            _loggerService = loggerService;
            _addService = addService;
        }

        public ActionResult Index(int num1 = 9, int num2 = 10)
        {
            _loggerService.Logger(num1.ToString() + "+" + num2.ToString() + "=" + _addService.Add(num1, num2).ToString() + "    " + "\r\n");
            return Content(_loggerService.GetLogger());
        }
    }
}